package com.example.phpclient.fragment;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.phpclient.R;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public class fragment_qd extends Fragment {
    SharedPreferences pref;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        pref = getActivity().getSharedPreferences("data",0);//fragment里调用sharedpreference也难不倒我
        View view = inflater.inflate(R.layout.qd_fragment,container,false);
        TextView name = view.findViewById(R.id.qdname);
        name.setText(pref.getString("s_name",""));
        return view;
    }

}



